package com.h3c.nem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.h3c.nem.entity.TbFlowInst;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Copyright (C), 2020-2020, h3c
 * FileName: TbFlowInstMapper
 *
 * @Author: l22886
 * @Date: 2022-01-19
 * Description: tb_flow_inst mapper
 * Version: 1.0
 */
public interface TbFlowInstMapper extends BaseMapper<TbFlowInst> {

    /**
     * @title: queryListByFuzzy
     * @description: 模糊列表查询
     * @params: [ TbFlowInst ]
     * @return: java.util.List
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public List<TbFlowInst> queryListByFuzzy(TbFlowInst TbFlowInst);

    @Select("select 1 from tb_flow_inst where approval_user_ids =#{userId} and flow_status in (12,13,22,23,32) limit 1")
    public Integer checkApprover(@Param("userId")String userId);

    /**
     * @title: queryListByFuzzy
     * @description: 精确列表查询
     * @params: [ TbFlowInst ]
     * @return: java.util.List
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public List<TbFlowInst> queryList(TbFlowInst TbFlowInst);

    public List<TbFlowInst> queryFlowInstInOrder(String workerId);
    /**
     * @title: updateTbFlowInst
     * @description: 更新
     * @params: [ TbFlowInst ]
     * @return: java.lang.Integer
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public Integer updateTbFlowInst(TbFlowInst TbFlowInst);

    /**
     * @title: insertTbFlowInst
     * @description: 插入
     * @params: [ TbFlowInst ]
     * @return: java.lang.Integer
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public Integer insertTbFlowInst(TbFlowInst TbFlowInst);

    /**
     * @title: deleteTbFlowInst
     * @description: 删除
     * @params: [ TbFlowInst ]
     * @return: java.lang.Integer
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public Integer deleteTbFlowInst(TbFlowInst TbFlowInst);
}
